﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using netDxf;
using netDxf.Entities;

namespace SmallERP.COM
{
    public  class NetDXFExtend
    {
        /// <summary>
        /// 文件路径
        /// </summary>
        /// <param name="inPath"></param>
        /// <returns>裁切信息</returns>
        public List<CutInfo> GetCutInfo(string inPath)
        {
             List<CutInfo> rtnList=new List<CutInfo>();
            if (!Directory.Exists(inPath))
            {
                return rtnList;
            }
            DxfDocument dxfDocument = DxfDocument.Load(inPath);
           List<Line> srcLinelist = dxfDocument.Lines.ToList();
           List<Point> srcPointlist = dxfDocument.Points.ToList();
            Vector3 minLineStPoint = srcLinelist.Select(s => s.StartPoint).Min(m => m);
            Vector3 minLineEndPoint = srcLinelist.Select(s => s.EndPoint).Min(m => m);
            var minPoint = srcPointlist.Min(m => m);
             return new List<CutInfo>();
        }
    }

    public class CutInfo
    {
        public double X { get; set; }
        public double Y { get; set; }
        public int UpDown { get; set; }//0dowm 1up

    }
}
